fix: enable creation of versions with commit sha postfix#156
Open
mikael-andersson91 wants to merge 3 commits intomathieudutour:masterfrom
Open
fix: enable creation of versions with commit sha postfix#156mikael-andersson91 wants to merge 3 commits intomathieudutour:masterfrom
mikael-andersson91 wants to merge 3 commits intomathieudutour:masterfrom
Conversation
Use the GITHUB_EVENT_NAME environment variable to determine if the triggering event of the workflow was a pull request.
add test case to verify that tag does not get created on pull requests
* refactor: move prerelease branch check to function * refactor: move prerelease identifier to function Get commit sha as identifier on pr. Get identifier for prereleases * fix: create tag for pull requests with shortened commit sha * ci: update actions checkout to v3
luber
approved these changes
Oct 23, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
These changes are intended to enable creation of new versions with commit hash as a postfix, without generating an associated tag.
How
Identifying pull requests is done by using the GitHub Environment variable GITHUB_EVENT_NAME to identify when the action is triggered by a pull request, read more here. This event is used in the isPr function to identify pull requests. The following functionalities has also been refactored to functions in the utils.ts file:
Why
I started experimenting with these changes after creating issue #150 where I noted that the current version of this action does not generate new versions with the commit hash suffix on pull requests targeted at main branch, as described in the Filter branches section of the documentation. During this work I also noticed that some functionality could be refactored into functions for improved readability of the code. Using the environment variable for event name also seemed like a more stable way of identifying pull requests than what was previously in place.
NOTE: This is pretty much a duplicate of pull request 151 which I will be closing. Going to take the master branch of my fork in a different direction but still wanted to keep these changes as an option for this repository.